/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.control.mapper;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hopes.bizz.risk.control.entity.RiskUnitEntity;
import com.hopes.bizz.risk.control.vo.RiskUnitVO;
import com.hopes.bizz.risk.statistic.vo.RiskObjectStatisticVO;
import com.hopes.boss.admin.api.entity.SysDictItem;
import com.hopes.boss.common.data.datascope.BossBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 风险分析单元
 *
 * @author daijie
 * @date 2023-07-17 18:53:13
 */
@Mapper
public interface RiskUnitMapper extends BossBaseMapper<RiskUnitEntity> {

    /**
     * 分页查询
     * @param page
     * @return
     */
    Page<RiskUnitEntity> listPage(Page<RiskUnitEntity> page, @Param("entity") RiskUnitEntity entity);


    /**
     * 查询风险分析单元
     * @param id           风险单元Id
     * @return             风险单元Vo
     */
    RiskUnitVO getUnitVoById(Long id);

    /**
     * 统计风险对象所绑定的单元数量
     *
     * @param id
     * @return
     */
    Integer getCountLByRiskObjectId(Long id);

    /**
     * 风险分析单元集合
     *
     * @return
     */
    List<SysDictItem> labelValueList();

    /**
     * 风险对象管控统计
     * @return  集合
     */
    List<RiskObjectStatisticVO> listRiskObjectStatisticVO();
}
